#!/usr/bin/node

const log = console.log,
      Dog = require('./05-dog');

let taidi  = new Dog('taiidi',4),
    zangao = new Dog('zangao',8);

taidi.on('bark',onBark.bind(taidi));
zangao.on('bark',onBark.bind(zangao));

function onBark(){
  log('%s barked! energy! %s',this.name,this.energy);
}
